// 新版本使用createRouter来创建路由
import { createRouter, createWebHashHistory } from 'vue-router'

export const Layout = () => import("../pages/IndexPage.vue");
export const constantRoutes = [
  {
    path: "/index-page",
    component: () => import("../pages/IndexPage.vue"),
    meta: { hidden: true, title: "" },
  },
  {
    path: "/",
    name: "/Home",
    component: Layout,
    redirect: "/index-page",
    children: [
      {
        path: "index-page",
        component: () => import("../pages/IndexPage.vue"),
        name: "index-page",
        meta: {
          title: "Index Page",
          affix: true,
          keepAlive: true,
          alwaysShow: false,
        },
      },
    ],
  },
  {
    path: "/menu-one",
    component: () => import("../pages/MenuOne.vue"),
    name: "menu-one",
    meta: {
      title: "Menu One",
      affix: true,
      keepAlive: true,
      alwaysShow: false,
    },
  },
  {
    path: "/menu-two",
    component: () => import("../pages/MenuTwo.vue"),
    name: "menu-two",
    meta: {
      title: "Menu Two",
      affix: true,
      keepAlive: true,
      alwaysShow: false,
    },
  },
  {
    path: "/menu-three",
    component: () => import("../pages/MenuThree.vue"),
    name: "menu-three",
    meta: {
      title: "Menu Three",
      affix: true,
      keepAlive: true,
      alwaysShow: false,
    },
  },
  {
    path: "/menu-four",
    component: () => import("../pages/MenuFour.vue"),
    name: "menu-four",
    meta: {
      title: "Menu Four",
      affix: true,
      keepAlive: true,
      alwaysShow: false,
    },
  },
]
const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes
})
export default router
